package wangle.com.baselibs.views;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Bundle;
import android.widget.ProgressBar;

import com.github.ybq.android.spinkit.style.DoubleBounce;

import wangle.com.baselibs.R;
import wangle.com.baselibs.utils.api.LoadProgressApi;

/**
 * 加载动画
 * Created by Administrator on 2017/2/6.
 */

public class LoadProgressView extends ProgressDialog implements LoadProgressApi{
    public LoadProgressView(Context context) {
        super(context, R.style.LoadingDialogLight);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.loading_progress);
        ProgressBar progressBar = (ProgressBar)findViewById(R.id.progress);
        DoubleBounce doubleBounce = new DoubleBounce();
        progressBar.setIndeterminateDrawable(doubleBounce);
        setCancelable(false);
    }

    @Override
    public void showDialog() {
        super.show();
        this.show();
    }

    @Override
    public void hideDialog() {
        super.hide();
        this.dismiss();
    }
}

